﻿using System;
using System.Collections.Generic;

namespace Pharma
{
    class SaleCatalog
    {
        public List<Sales> ls;
        public SaleCatalog()
        {
            ls = new List<Sales>();
        }
        public void Accept(int n)
        {
            for (int i = 0; i < n; i++)
            {
                Sales sa = new Sales();
                sa.Accept();
                ls.Add(sa);
            }
        }

        public void Display()
        {
            foreach (var item in ls)
            {
                item.Display();
            }
        }
        public void Display(bool bol)
        {
            foreach (var item in ls)
            {
                if (item.plannedSales > item.actualSales)
                {
                    Console.WriteLine("Planned Sales > Actual Sales:"); // in thong bao
                    break;
                }
            }
            foreach (var item in ls)
            {
                if(item.plannedSales > item.actualSales)
                item.Display(); // in chi tiet
            }
            foreach (var item in ls)
            {
                if (item.plannedSales == item.actualSales)
                {
                    Console.WriteLine("Planned Sales == Actual Sales:"); // in ra thong bao
                    break;
                }
            }
            foreach (var item in ls)
            {
                if (item.plannedSales.Equals(item.actualSales))
                    item.Display();
            }
            foreach (var item in ls)
            {
                if (item.plannedSales < item.actualSales)
                {
                    Console.WriteLine("Planned Sales < Actual Sales:");
                    break;
                }
            }
            foreach (var item in ls)
            {
                if (item.plannedSales < item.actualSales)
                    item.Display();
            }
        }

    }
}
